package org.jackkang.elasticsearch.model;

import java.io.Serializable;

import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldIndex;
import org.springframework.data.elasticsearch.annotations.FieldType;
/**
 * 
 * @ClassName: News
 * @Description: 对应elasticsearch的indexName和type
 * @author  kangjie1209@163.com
 * @date 2015年10月21日 上午10:31:40
 *
 */
@Document(indexName = "news_database", type = "news",shards =5 ,replicas =1 )
public class News implements Serializable{
	/**
	 * @Fields serialVersionUID : 
	 */
	private static final long serialVersionUID = 1L;

	@Field(type = FieldType.Long)
	private Long id;

	@Field(
		type = FieldType.Date, 
		format = DateFormat.custom, pattern = "yyyy-MM-dd HH:mm:ss"
	)
	//@Field(type = FieldType.String)
	private String create_time;
	
	/** 没有使用FieldType.ip，是因为这种类型不能模糊搜索 */
	/** Not using FieldType.ip，because this type can't support fuzzy search. */
	/*@Field(index = FieldIndex.analyzed, type = FieldType.String)
	private String ip;*/

	/** 不序列化到_source */
	@Field(type = FieldType.String,searchAnalyzer="pinyin",indexAnalyzer ="mmseg")
	private String title;
	
	/**链接**/
	@Field(type = FieldType.String)
	//@JsonIgnore
	private String link;
	
	/**
	 * 点击数
	 */
	@Field(type = FieldType.Long)
	private String click_count;
	
    /**
     * 设置创建索引和搜索时的分词器
     */
	@Field(type = FieldType.String,searchAnalyzer="mmseg",indexAnalyzer ="mmseg")
	private String description;
	

	/**
	 * @return the create_time
	 */
	public String getCreate_time() {
		return create_time;
	}

	/**
	 * @return the title
	 */
	public String getTitle() {
		return title;
	}

	/**
	 * @return the link
	 */
	public String getLink() {
		return link;
	}

	/**
	 * @return the click_count
	 */
	public String getClick_count() {
		return click_count;
	}

	/**
	 * @return the description
	 */
	public String getDescription() {
		return description;
	}

	

	/**
	 * @param create_time the create_time to set
	 */
	public void setCreate_time(String create_time) {
		this.create_time = create_time;
	}

	/**
	 * @param title the title to set
	 */
	public void setTitle(String title) {
		this.title = title;
	}

	/**
	 * @param link the link to set
	 */
	public void setLink(String link) {
		this.link = link;
	}

	/**
	 * @param click_count the click_count to set
	 */
	public void setClick_count(String click_count) {
		this.click_count = click_count;
	}

	/**
	 * @param description the description to set
	 */
	public void setDescription(String description) {
		this.description = description;
	}

	/**
	 * @return the id
	 */
	public Long getId() {
		return id;
	}

	/**
	 * @param id the id to set
	 */
	public void setId(Long id) {
		this.id = id;
	}

	
}
